<script>
	import {getUser} from '@/static/js/api/login.js'
	import {set,get} from "@/static/js/uilt/index.js"
	export default {
	  onLaunch: async function() {
		  //获取地址栏code
			let url = location.href;
			let code = url.split('=')[1]
			if(!code){
				return
			}
			//code换取santoken及用户信息
			this.getuser(code)
		},
		onShow: function() {

		},
		onHide: function() {

		},
		methods:{
			async getuser(code){
				let data = {code};
				let res = await getUser(data);
				//console.log(res,"res");
				set("userData",res.data);
				get("userData");
				
			}
		}
	}
</script>

<style>
	/*每个页面公共css */
	* {
		margin: 0;
		padding: 0;
		box-sizing: border-box;
	}
</style>